|
|
|
|
|
|
|
Figure 14.20
Program Valley displaying a pseudo-random valley scene. |
|
|
|
|
|
|
|
|
Few people would be fooled into thinking the image produced by program Valley is a photograph of a real valley. At the same time, few people would have trouble understanding what the image represents, particularly in color. |
|
|
|
|
|
|
|
|
Program Valley uses different color shades to make its image easier to understand. Chapter 16, Shading Models, extends these methods to produce more realistic images for objects other than surfaces. |
|
|
|
|
|
|
|
|
Sometimes you might like to create a surface of a certain shape, but you do not know exactly what data points should make up the surface. For instance, you might like to create a shape like the one shown in Figure 14.21. Calculating where every point on this surface belonged would be quite tedious. Furthermore, this surface does not represent a simple function. For certain values of X and Z, this surface has more than one Y value. That means you cannot use the methods of the previous sections to store and display the data. |
|
|
|
|
|
|
|
|
One way to represent this sort of surface is using a system of parametric equations. For variables u and v, these equations give the X, Y, and Z coordinates of points on the surface. Usually the equations are chosen so that the surface is traced out when the variables u and v run between 0.0 and 1.0. The two particular kinds of parametric curves described in the following sections are Bezier surfaces and B-splines. These surfaces are the three-dimensional counterparts of the Bezier curves and B-splines described in Chapter 11, Drawing Curves. |
|
|
|
|
|